<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<!-- Mirrored from centaurus.adbee.technology/form-wysiwyg.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 02 Aug 2014 05:38:10 GMT -->
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>맛집 세상 관리자</title>
<script type="text/javascript" src="js/html_editor.js"></script>
<link rel="stylesheet" type="text/css" href="css/mytypeBoardAdmin.css"/>
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
function lfn_update() {
	if(frm.subject.value=="") {
		alert("제목을 입력해 주세요.");
		frm.subject.focus();
		return false;
	}
	frm.contents.value=postContent();
if(frm.contents.value=="") {
	alert("내용을 입력해 주세요.");
	frm.contents.focus();
	return false;
}
if(confirm("수정하시겠습니까?")){
	 frm.method="POST";
	 frm.action="<%=request.getContextPath()%>/faqUpdate.do";
	 frm.submit();
	}
}
// edit
function initE(){
		
		var cw = document.getElementById("content").contentWindow;
		cw.document.designMode = "on";
		cw.document.open("text/html");
		cw.document.write("<html><head><style>.Background {background-color:#FFFFFF}P {margin-top:2px;margin-bottom:2px;} table {border:1px solid #C6C3C6}</style></head><body class=\"Background\"></body></html>");
		cw.document.close();
		
		cw.document.body.style.fontSize = "9pt";
		cw.document.body.style.fontFamily = "돋움";
		
		cw.document.body.innerHTML=frm.contents.value;
		
		if (navigator.userAgent.indexOf("MSIE 6") > 0 || 
			navigator.userAgent.indexOf("MSIE 7") > 0 || 
			navigator.userAgent.indexOf("MSIE 8") > 0 ||
			navigator.userAgent.indexOf("MSIE 9") > 0 ||
			navigator.userAgent.indexOf("MSIE 10") > 0) {
			alert('익스플로러 브라우저는 에디터 사용시 블럭잡아서 변경해주세요.');
		}
	}
</script>
<script type="text/javascript">
//<![CDATA[
try{if (!window.CloudFlare) {var CloudFlare=[{verbose:0,p:1406277561,byc:0,owlid:"cf",bag2:1,mirage2:0,oracle:0,paths:{cloudflare:"/cdn-cgi/nexp/dokv=88e434a982/"},atok:"c7408377f8f729eb5c451d460f3aaf80",petok:"92221131326dc1d45c94722c1eaf464568e686f4-1406957800-1800",zone:"adbee.technology",rocket:"0",apps:{"ga_key":{"ua":"UA-49262924-2","ga_bs":"2"}}}];!function(a,b){a=document.createElement("script"),b=document.getElementsByTagName("script")[0],a.async=!0,a.src="../ajax.cloudflare.com/cdn-cgi/nexp/dokv%3d97fb4d042e/cloudflare.min.js",b.parentNode.insertBefore(a,b)}()}}catch(e){};
//]]>
</script>
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />

<link href="css/libs/font-awesome.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" href="css/libs/nanoscroller.css" type="text/css" />

<link rel="stylesheet" type="text/css" href="css/compiled/layout.css">
<link rel="stylesheet" type="text/css" href="css/compiled/elements.css">


<link type="image/x-icon" href="favicon.png" rel="shortcut icon" />

<link
	href='http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,300|Titillium+Web:200,300,400'
	rel='stylesheet' type='text/css'>
<!--[if lt IE 9]>
		<script src="js/html5shiv.js"></script>
		<script src="js/respond.min.js"></script>
	<![endif]-->
<script type="text/javascript">
/* <![CDATA[ */
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-49262924-2']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

(function(b){(function(a){"__CF"in b&&"DJS"in b.__CF?b.__CF.DJS.push(a):"addEventListener"in b?b.addEventListener("load",a,!1):b.attachEvent("onload",a)})(function(){"FB"in b&&"Event"in FB&&"subscribe"in FB.Event&&(FB.Event.subscribe("edge.create",function(a){_gaq.push(["_trackSocial","facebook","like",a])}),FB.Event.subscribe("edge.remove",function(a){_gaq.push(["_trackSocial","facebook","unlike",a])}),FB.Event.subscribe("message.send",function(a){_gaq.push(["_trackSocial","facebook","send",a])}));"twttr"in b&&"events"in twttr&&"bind"in twttr.events&&twttr.events.bind("tweet",function(a){if(a){var b;if(a.target&&a.target.nodeName=="IFRAME")a:{if(a=a.target.src){a=a.split("#")[0].match(/[^?=&]+=([^&]*)?/g);b=0;for(var c;c=a[b];++b)if(c.indexOf("url")===0){b=unescape(c.split("=")[1]);break a}}b=void 0}_gaq.push(["_trackSocial","twitter","tweet",b])}})})})(window);
/* ]]> */
</script>
</head>
<body onload="initE();">
	<%-- 상 단 --%>
	<jsp:include page="../include/top.jsp"></jsp:include>
	<%-- 상 단 끝 --%>
	<div id="content-wrapper">
		<div class="row">
			<div class="col-lg-12">
				<div class="row">
					<div class="col-lg-12">
						<ol class="breadcrumb">
							<li><a href="#">Home</a></li>
							<li class="active"><span>FAQ</span></li>
						</ol>
						<h1>FAQ</h1>
					</div>
				</div>
				<div class="row">
					<div class="col-lg-12">
						<div class="main-box clearfix" style="min-height: 820px;">
							<header class="main-box-header clearfix">
							<h2>FAQ 글쓰기</h2>
							</header>
							<form name="frm">
							<input type="hidden" name="num" value="${faq.num}">
							<div class="main-box-body clearfix">
								<div id="alerts"></div>
								<div class="btn-toolbar editor-toolbar"
									data-role="editor-toolbar" data-target="#editor">
									<div class="row">
										<div class="form-group col-xs-12">
											<input type="text" class="form-control"
												placeholder="글 제목.." name="subject" value="${faq.subject}">
										</div>
									</div>
									<input type="text" data-edit="inserttext" id="voiceBtn"
										x-webkit-speech="">
								</div>
							<!-- Html Editor -->
										<table style="border: 0px; border-spacing: 0px; border-collapse: 0px; width: 98%; margin: 0 auto;">
											<tbody>
											<tr class="WriteBG" style="height: 30px; vertical-align: middle;">
												<td>
													<select onchange="setFont(this)" id="select1" name="select1" style="vertical-align: middle;margin-top: 7px;margin-left: 5px;">
												        <option value="" selected="selected">글꼴</option>
												        <option value="돋움">돋움</option>
												        <option value="굴림">굴림</option>
												        <option value="바탕">바탕</option>
												        <option value="궁서">궁서</option>
												        <option value="verdana">verdana</option>
												        <option value="times">times</option>
											        </select>&nbsp;
											        
											        <select onchange="setFontSize(this)" id=select2 name=select2 style="vertical-align: middle;margin-top: 7px;margin-left: 5px;">
												        <option value="" selected="selected">크기</option>
												        <option value="1">7</option>
												        <option value="2">10</option>
												        <option value="3">12</option>
												        <option value="4">14</option>
												        <option value="5">18</option>
											        </select>&nbsp;
											        
											        <img src="img/board/ico_divLine.gif" align="middle" alt="line"/>&nbsp;
											        
											        <a href="javascript:;" onclick="editContent('Bold')">
											        	<img src="img/board/ico_btn_bold.gif" class=imagebtnBG align="middle" style="border: 1px solid #E4E4E4;"
											        	onmouseover="this.style.border='1px solid black'" onmouseout="this.style.border='1px solid #E4E4E4'" alt="굵게"/></a>
											        <a href="javascript:;" onclick="editContent('Underline')">
											        	<img src="img/board/ico_btn_underline.gif" class=imagebtnBG align="middle"  style="border: 1px solid #E4E4E4;"
											        	onmouseover="this.style.border='1px solid black'" onmouseout="this.style.border='1px solid #E4E4E4'" alt="밑줄"/></a>
											        <a href="javascript:;" onclick="editContent('Italic')">
											        	<img src="img/board/ico_btn_italic.gif" class=imagebtnBG align="middle"  style="border: 1px solid #E4E4E4;"
											        	onmouseover="this.style.border='1px solid black'" onmouseout="this.style.border='1px solid #E4E4E4'" alt="기울임"/></a>
											        <a href="javascript:;" onclick="editContent('StrikeThrough')">
											        	<img src="img/board/ico_btn_strike.gif" class=imagebtnBG align="middle" style="border: 1px solid #E4E4E4;"
											        	onmouseover="this.style.border='1px solid black'" onmouseout="this.style.border='1px solid #E4E4E4'" alt="가운데밑줄"/></a>&nbsp;&nbsp;&nbsp;
											        <a href="javascript:;" onclick="editContent('fontcolor')">
											        	<img src="img/board/ico_btn_fontColor.gif" class=imagebtnBG align="middle" style="border: 1px solid #E4E4E4;"
											        	onmouseover="this.style.border='1px solid black'" onmouseout="this.style.border='1px solid #E4E4E4'" alt="글자색"/></a>
											        	
											        <div style="position:absolute;display:none;overflow:hidden;" id="TableFontColor"></div>
											        
											        <a href="javascript:;" onclick="editContent('bgcolor')">
											        	<img src="img/board/ico_btn_fontBG.gif" class=imagebtnBG align="middle" style="border: 1px solid #E4E4E4;"
											        	onmouseover="this.style.border='1px solid black'" onmouseout="this.style.border='1px solid #E4E4E4'" alt="글자배경색"/></a>&nbsp;
											        	
											        <div style="position:absolute;display:none;overflow:hidden;" id="TableBGColor"></div>
											        
											        <!-- <a href="javascript:;" onclick="editContent('link')">
											        		<img src="img/board/ico_btn_url.gif" class=imagebtnBG align="middle" style="border: 1px solid #E4E4E4;"
											        		onmouseover="this.style.border='1px solid black'" onmouseout="this.style.border='1px solid #E4E4E4'" alt="링크삽입"/></a>&nbsp; -->
											        
											        <img src="img/board/ico_divLine.gif" align="middle" alt="line"/>&nbsp;
											        
											        <a href="javascript:;" onclick="editContent('JustifyLeft')">
											        	<img src="img/board/ico_btn_leftAlign.gif" class=imagebtnBG align="middle" style="border: 1px solid #E4E4E4;"
											        	onmouseover="this.style.border='1px solid black'" onmouseout="this.style.border='1px solid #E4E4E4'" alt="왼쪽정렬"/></a>
											        <a href="javascript:;" onclick="editContent('JustifyCenter')">
											        	<img src="img/board/ico_btn_centerAlign.gif" class=imagebtnBG align="middle" style="border: 1px solid #E4E4E4;"
											        	onmouseover="this.style.border='1px solid black'" onmouseout="this.style.border='1px solid #E4E4E4'" alt="가운데정렬"/></a>
											        <a href="javascript:;" onclick="editContent('JustifyRight')">
											        	<img src="img/board/ico_btn_rightAlign.gif" class=imagebtnBG align="middle" style="border: 1px solid #E4E4E4;"
											        		onmouseover="this.style.border='1px solid black'" onmouseout="this.style.border='1px solid #E4E4E4'" alt="오른쪽정렬"/></a>&nbsp;
											        		
											        <img src="img/board/ico_divLine.gif" align="middle" alt="line"/>&nbsp;
											
											        
											   </td>
											</tr>
											
											<tr>
												<td>
													<iframe id="content" name="content" src="about:blank" class="WritePost" style="width:100%;height:300px;" scrolling="auto" frameborder=0 ></iframe>
													<textarea id="contents" name="contents" style="width: 98%; height: 300px; padding: 10px; background-color: rgb(239, 239, 239); display: none;" class="tbox" placeholder="글 제목.." >
													${faq.contents}
													</textarea>
													<div id="DIVcontent" style="display:none" ></div> 
												</td>
											</tr>
											</tbody>
										</table>
										<!-- /Html Editor -->
								</br>
								<div class="pull-right">
									<button type="button" class="btn btn-default">취 소</button>
									<button type="button" class="btn btn-primary" onclick="lfn_update();">수 정</button>
								</div>
							</div>
						</form>
						</div>

					</div>

				</div>

			</div>
		</div>
		<%-- 하단 --%>
		<jsp:include page="../include/bottom.jsp"></jsp:include>
		<%-- 하단 끝 --%>
	</div>
	</div>
	</div>

	<script src="js/demo-skin-changer.js"></script>
	<script src="js/jquery.js"></script>
	<script src="js/bootstrap.js"></script>
	<script src="js/jquery.nanoscroller.min.js"></script>
	<script src="js/demo.js"></script>

	<script src="js/jquery.hotkeys.js"></script>
	<script src="js/bootstrap-wysiwyg.js"></script>

	<script src="js/scripts.js"></script>

	<script>
	$(function(){
		function initToolbarBootstrapBindings() {
			var fonts = ['Serif', 'Sans', 'Arial', 'Arial Black', 'Courier', 
						'Courier New', 'Comic Sans MS', 'Helvetica', 'Impact', 'Lucida Grande', 'Lucida Sans', 'Tahoma', 'Times',
						'Times New Roman', 'Verdana'],
				fontTarget = $('[title=Font]').siblings('.dropdown-menu');
			
			$.each(fonts, function (idx, fontName) {
				fontTarget.append($('<li><a data-edit="fontName ' + fontName +'" style="font-family:\''+ fontName +'\'">'+fontName + '</a></li>'));
			});
			$('a[title]').tooltip({container:'body'});
			$('.dropdown-menu input').click(function() {return false;})
				.change(function () {$(this).parent('.dropdown-menu').siblings('.dropdown-toggle').dropdown('toggle');})
				.keydown('esc', function () {this.value='';$(this).change();});

			$('[data-role=magic-overlay]').each(function () { 
				var overlay = $(this), target = $(overlay.data('target')); 
				overlay.css('opacity', 0).css('position', 'absolute').offset(target.offset()).width(target.outerWidth()).height(target.outerHeight());
			});
			if ("onwebkitspeechchange"	in document.createElement("input")) {
				var editorOffset = $('#editor').offset();
				$('#voiceBtn').css('position','absolute').offset({top: editorOffset.top, left: editorOffset.left+$('#editor').innerWidth()-35});
			} else {
				$('#voiceBtn').hide();
			}
		};
		function showErrorAlert (reason, detail) {
			var msg='';
			if (reason==='unsupported-file-type') { msg = "Unsupported format " +detail; }
			else {
				console.log("error uploading file", reason, detail);
			}
			$('<div class="alert"> <button type="button" class="close" data-dismiss="alert">&times;</button>'+ 
			 '<strong>File upload error</strong> '+msg+' </div>').prependTo('#alerts');
		};
			initToolbarBootstrapBindings();	
		$('#editor').wysiwyg({ fileUploadError: showErrorAlert} );
	});
	</script>
</body>
</html>